package collection;

import java.util.HashSet;
import java.util.Iterator;

public class MyHashSet {
    public static void main(String args[]){

        HashSet<String>sp=new HashSet<String>();
        sp.add("abcde");
        sp.add("sad");
        sp.add("saw");
        sp.add("sw");
        sp.add("saw");
        System.out.println(sp.contains("sw"));
        for(String st:sp){
            System.out.print(st+" ");
        }
        System.out.println();
        sp.remove("sw");
        Iterator<String>it=sp.iterator();
        while(it.hasNext()){
            System.out.print(it.next()+" ");
        }

        System.out.println();
    }
}
